<?php
namespace app\common\model;

use think\Model;

class TaskType extends Model
{
    // 指定表名,不含前缀
    protected $name = 'task_type';

    /**
     * @param array|null $arg
     * @param string $field
     * @param int $argor
     * @return array|bool|false|\PDOStatement|string|\think\Collection
     */
    public function getListByArg(array $arg=null,$field='*',$argor=1){
        if (!is_array($arg))return false;
        $arg = $this->where($arg)->whereOr($argor)->field($field)->select();
        return $arg;
    }

    /**
     * @param array|null $arg
     * @param string $field
     * @return array|bool|false|\PDOStatement|string|Model
     */
    public function getListByArgOne(array $arg=null,$field='*'){
        if (!is_array($arg))return false;
        $arg = $this->where($arg)->field($field)->find();
        return $arg;
    }
}
